import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
import menu_model from "./model/menu"
import role_model from "./model/role"
import user_model from "./model/user"
import cate_model from "./model/category"
import specs_model from "./model/specs"
import goods_model from "./model/goods"

export default new Vuex.Store({
  state: {
    nav_list:[]
  },
  mutations: {
    navListMutations(state){
      const navList = JSON.parse(localStorage.getItem('loginData')|| '{}')
      if(navList){
        state.nav_list=navList.menus
      }
    }
  },
  actions: {
  },
  modules: {
    menu_model: menu_model,
    role_model:role_model,
    user_model:user_model,
    cate_model:cate_model,
    goods_model:goods_model,
    specs_model:specs_model
  }
})
